﻿using HDUSampling.HDUControls.HTools.LoadingFrm;
using HMI.Tool;
using HMI.View.OrderFrmTools;
using Prism.Commands;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WLMes.Models;

namespace HMI.Model
{
    public class OrderListViewModel
    {
        public OrderListViewModel()
        {
            ViewDatasCommand = new DelegateCommand<OrderList>(ViewDatas);
        }
        public DelegateCommand<OrderList> ViewDatasCommand { get; set; }
        SqlSugarHelper SuSql = new SqlSugarHelper();
        private void ViewDatas(OrderList orderList)
        {
            //BusyUtil busy = new BusyUtil(orderList.kl);
            //busy.Start(4000);
            DateTime strat = orderList.dt1.dateTime;
            DateTime end = orderList.dt2.dateTime;
            List<ProcessInfoVO> infos= SuSql.db.Queryable<ProcessInfoVO>()
                .Where(t=>t.processinfoUserTime>=strat && t.processinfoUserTime<= end).ToList();
            orderList.dg.ItemsSource= infos;

        }
    }
}
